﻿/*****************************************************************//**
 * @file   FITKGraphObjectElementLoadBase.h
 * @brief  Graph object base for element set load.
 *
 * @author ChengHaotian (yeguangbaozi@foxmail.com)
 * @date   2024-04-13
 *********************************************************************/

#ifndef __FITKGRAPHOBJECTELEMENTLOADBASE_H__
#define __FITKGRAPHOBJECTELEMENTLOADBASE_H__

#include "FITKGraphObjectLoadBase.h"

#include "FITKVTKGraphAdaptorAPI.h"

// Forward declaration
class FITKGraphActor;

namespace Comp
{
    class FITKGraphRender;
}

namespace Interface
{
    class FITKModelSet;
    class FITKBoundaryLocation;
    class FITKAbstractAssInstance;
}

namespace AbaqusData
{
    class FITKAbaqusPart;
}

namespace Exchange
{
    /**
     * @brief   Graph object base for element set load.
     * @author  ChengHaotian (yeguangbaozi@foxmail.com)
     * @date    2024-04-13
     */
    class FITKVTKGRAPHADAPTORAPI FITKGraphObjectElementLoadBase : public FITKGraphObjectLoadBase
    {
        // Regist
        FITKGraphObjectRegist(FITKGraphObjectElementLoadBase, FITKGraphObjectLoadBase);
        FITKCLASS(Exchange, FITKGraphObjectElementLoadBase);

    public:
        /**
         * @brief   Constructor.
         * @param   caseData: The case data
         * @param   loadData: The element or face load data object
         * @param   stepId: The stepId
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-04-13
         */
        FITKGraphObjectElementLoadBase(AbaqusData::FITKDataCase* caseData, Interface::FITKBoundaryLocation* loadData, int stepId = 0);

        /**
         * @brief   Destructor.[virtual]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-04-13
         */
        virtual ~FITKGraphObjectElementLoadBase() = default;

    protected:
        /**
         * @brief   Constructor.
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-07-01
         */
        FITKGraphObjectElementLoadBase() = default;

        /**
         * @brief   Generate the poly data for the gravity or body force load.[virtual][override]
         * @param   load: The gravity or body force load data object
         * @return  Is OK
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-04-25
         */
        virtual bool generatePolyData(Interface::FITKBoundaryLocation* load) override;

        /**
         * @brief   Generate the poly data with the given set or comp-set.
         * @param   set: The set data object
         * @param   instanceId: The set's parent instance id[default]
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-04-29
         */
        void generateSetPolyData(Interface::FITKModelSet* set, int instanceId = -1);

        /**
         * @brief   Generate vtkPoints with the set data object.
         * @param   set: The set data object
         * @param   part: The part data object
         * @param   value: The body force value
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-04-13
         */
        void generateCenterPointsWithSet(Interface::FITKModelSet* set, AbaqusData::FITKAbaqusPart* part);

        /**
         * @brief   Generate vtkPoints with the set data object.
         * @param   set: The set data object
         * @param   instance: The instance data object
         * @param   value: The body force value
         * @author  ChengHaotian (yeguangbaozi@foxmail.com)
         * @date    2024-04-13
         */
        void generateCenterPointsWithSet(Interface::FITKModelSet* set, Interface::FITKAbstractAssInstance* instance);

    };
}   // namespace Exchange

#endif // __FITKGRAPHOBJECTELEMENTLOADBASE_H__
